<script setup lang="ts">
defineProps({
  modelValue: {
    type: Number,
    default: 0
  }
})
const emit = defineEmits<{
  (e: 'update:modelValue', value: number): void
}>()
const changeFn = () => {
  emit('update:modelValue', 999)
}
</script>
<template>
  <div style="border: 2px solid #000; margin: 20px">
    子组件 -- {{ modelValue }} <button @click="changeFn">修改</button>
  </div>
</template>
<style scoped>
</style>